import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SGuildStruggleInfo } from "../../../../../Message/Public/SGuildStruggleInfo";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class GuildStruggleInfoCommand
    
    export  class GuildStruggleInfoCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            super.call(arg1);
            var loc1=arg1.messageBase as SGuildStruggleInfo;
            var loc2=_cache.copy.guildStruggleInfo;
            _cache.copy.guildStruggleInfo = loc1;
            if (!loc2 || loc2.layer + 1 == loc1.layer) 
            {
                NetDispatcher.dispatchCmd(ServerCommand.GuildStruggleEnterLayer, loc1);
            }
            NetDispatcher.dispatchCmd(ServerCommand.GuildStruggleInfoChange, loc1);
            return;
        }
    }
